<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
    <h1 id="a">10</h1>

    <script>

        // 倒计时？  拿一个计数器，每隔1s  -- 

        var oH1 = document.getElementById('a') ;

        var count = 10 ;
        var t = setInterval(function(){
            count-- ;
            if(count === 0) {
                clearInterval(t) ;
            }
            oH1.innerHTML = count ;
        } , 1000)

    </script>
</body>
</html>